//
//  L_FootPlayVIew.m
//  音悦咖
//
//  Created by dllo on 15/7/15.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "L_FootPlayVIew.h"
#import "BaseHeader.h"
@implementation L_FootPlayVIew

- (void)dealloc
{
    [_bgImage release];
    [_mainImage release];
    [_songName release];
    [_songerName release];
    [_playOrPause release];
    [_nextSong release];
    [_playList release];
    [super dealloc];
}


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 创建背景图片
        self.bgImage = [[UIImageView alloc] initWithFrame:self.bounds];
        self.bgImage.image = [UIImage imageNamed:@"color.jpg"];
        [self addSubview:self.bgImage];
        [_bgImage release];

        
        //  创建ImageView
        self.mainImage = [[UIImageView alloc] init];
        self.mainImage.frame = CGRectMake(2, 2, self.frame.size.height - 4, self.frame.size.height - 4);
        self.mainImage.userInteractionEnabled = YES;
        //self.mainImage.backgroundColor = [UIColor redColor];
        [self addSubview:self.mainImage];
        [_mainImage release];
        
        // 创建歌名Label
        self.songName = [[UILabel alloc] initWithFrame:CGRectMake(self.mainImage.frame.size.width + 10, 5, self.frame.size.width / 4 + 20, self.frame.size.height / 3)];
        //self.songName.backgroundColor = [UIColor orangeColor];
        [self addSubview:self.songName];
        [_songName release];
        
        // 创建歌手label
        self.songerName = [[UILabel alloc] initWithFrame:CGRectMake(self.mainImage.frame.size.width + 10, self.songName.frame.origin.y + self.songName.frame.size.height + 5, self.frame.size.width / 4 + 20, self.frame.size.height / 3)];
        //self.songerName.backgroundColor = [UIColor orangeColor];
        [self addSubview:self.songerName];
        [_songerName release];
        
        // 创建播放按钮
        self.playOrPause = [UIButton buttonWithType:UIButtonTypeCustom];
        //self.playOrPause.backgroundColor = [UIColor redColor];
        self.playOrPause.frame = CGRectMake(self.frame.size.width / 2, 5, self.frame.size.height - 10, self.frame.size.height - 10);
        [self addSubview:self.playOrPause];
        
        
        // 创建下一曲按钮
        self.nextSong = [UIButton buttonWithType:UIButtonTypeCustom];
        //self.nextSong.backgroundColor = [UIColor redColor];
        self.nextSong.frame = CGRectMake(SCREEN_WIDTH * 0.7, 10, self.frame.size.height / 3 * 2, self.frame.size.height / 3 * 2);

        [self addSubview:self.nextSong];
        
        
        // 播放列表
        self.playList = [UIButton buttonWithType:UIButtonTypeCustom];
        //self.playList.backgroundColor = [UIColor redColor];
        self.playList.frame = CGRectMake(self.frame.size.width - self.frame.size.height / 2 - 15, 10, self.frame.size.height / 3 * 2, self.frame.size.height / 3 * 2);
        [self addSubview:self.playList];

        
        
        
    }
    return self;
}



@end
